package com.strongdigit.ioc;


import org.junit.Assert;
import org.junit.Test;
import org.junit.Before;
import org.junit.After;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UnitTestBase {

    ApplicationContext context1;

    public UnitTestBase(){}

    public UnitTestBase(String path){

        context1=new ClassPathXmlApplicationContext(path);

    }


    public Object getBean(String beanName){

        if(!context1.equals(null))
        {
            return context1.getBean(beanName);
        }
        else return null;

    }




    @Before
    public void before() throws Exception {


    }

    @After
    public void after() throws Exception {


    }

}
